diff options
| author | real-zephex <[email protected]> | 2024-03-29 14:38:23 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-03-29 14:38:23 +0530 |
| commit | d9a9535ea8f38a1d63a7accd77e7175d5b822284 (patch) | |
| tree | 02680d7deb0f1b811fd00c42df86eabc24aee31d /src/app/manga/[title]/[id]/[read]/currentReading.jsx | |
| parent | Update README.md (diff) | |
| download | dramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.tar.xz dramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.zip | |
fix: manga page now indicates what chapter you are reading
Diffstat (limited to 'src/app/manga/[title]/[id]/[read]/currentReading.jsx')
| -rw-r--r-- | src/app/manga/[title]/[id]/[read]/currentReading.jsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/app/manga/[title]/[id]/[read]/currentReading.jsx b/src/app/manga/[title]/[id]/[read]/currentReading.jsx new file mode 100644 index 0000000..c368f75 --- /dev/null +++ b/src/app/manga/[title]/[id]/[read]/currentReading.jsx @@ -0,0 +1,27 @@ +"use client"; +import { useState, useEffect } from "react"; +import styles from "./read.module.css"; + +export default function CurrentReading() { + const [chapter, setChapter] = useState(null); + const [volume, setVolume] = useState(null); + + useEffect(() => { + setChapter(localStorage.getItem("chapter") || ""); + setVolume(localStorage.getItem("volume") || ""); + }); + + return CR(chapter, volume); +} + +function CR(chapter, volume) { + return ( + <div className={styles.CurrentReadingContainer}> + {chapter && volume && ( + <p> + Vol {volume} Chapter {chapter} + </p> + )} + </div> + ); +} |